Skip to main content

AWS CLI

AWS S3 CLI is the easiest way to interact with the object storage. The AWS S3 CLI can be configured to take the advantage of the Chainsafe Storage S3 Compatible API.

To configure the AWS S3 CLI please follow the below steps:

1. Install AWS CLI

You need to install the AWS cli on your system. You can follow the instructions from here.

2. Create an AWS profile

You need to create an AWS profile on your system. To create a new profile, you need to run the following command:

vi ~/.aws/credentials
[storage]
aws_access_key_id = xxx
aws_secret_access_key = xxx

NOTE:

You need to replace the xxx with your access key ID and secret access key which you generated from the dashboard.

3. Create a bucket

Now you can directly use the AWS commands to interact with the S3 compatible APIs. Here's an example of creating a bucket using the following command:

$ aws s3 mb s3://storage-s3-test --endpoint-url https://buckets.chainsafe.io --profile storage

Output:

    make_bucket: storage-s3-test

3. List the bucket

Lets list the bucket that we created above using the following command:

$ aws s3 ls --endpoint-url https://buckets.chainsafe.io --profile storage

Output:

    2022-05-11 14:36:46 storage-s3-test

NOTE:

--endpoint-url is the URL of the S3 compatible API.

--profile is the name of the AWS profile that you created in step 2.